package com.zmx.doctor.view.activity;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;

import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;

import com.zmx.doctor.BaseActivity;
import com.zmx.doctor.R;
import com.zmx.doctor.view.util.MySharedPreferences;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SetUpActivity extends BaseActivity {

    @BindView(R.id.relative3)
    RelativeLayout relative3;
    @BindView(R.id.relative1)
    RelativeLayout relative1;
    @BindView(R.id.relative2)
    RelativeLayout relative2;
    @BindView(R.id.relative4)
    RelativeLayout relative4;
    @BindView(R.id.relative5)
    RelativeLayout relative5;
    @Override
    protected int getLayoutId() {
        return R.layout.activity_set_up;
    }

    @Override
    protected void initViews() {

        ButterKnife.bind(this);
        setToolbar(R.id.tool_bar);

    }

    @OnClick({R.id.relative1, R.id.relative2, R.id.relative3,R.id.relative4,R.id.relative5,R.id.relative6})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.relative1:

                Toast("最新版本了");

                break;
            case R.id.relative2:

                new AlertDialog.Builder(mActivity)
                        .setTitle("提示")
                        .setMessage("是否清理缓存？")
                        .setPositiveButton("确定", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i) {
                                Toast("清理成功");
                            }
                        })
                        .setNegativeButton("取消", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i) {

                            }
                        }).show();

                break;
            case R.id.relative3:

                //清空本地所有数据
              startActivity(AboutUsActivity.class);

                break;
            case R.id.relative4:

                startActivity(FeedbackActivity.class);

                break;
            case R.id.relative5:

                startActivity(ModifyPhoneNumberActivity.class);

                break;
            case R.id.relative6:

                startActivity(ModifyPwdActivity.class);
                this.finish();

                break;
        }
    }
}
